{% load i18n %}
{% load url from future %}

<ul class="breadcrumb">
    <li><a href="{% url 'admin:index' %}" title="{% trans "Go back to admin homepage" %}">{% trans "Home" %}</a><span class="divider">/</span></li>
    <li><a href="{% url 'admin:index' %}filer/" title="{% trans "Go back to Filer app" %}"> {% trans "Media" %}</a><span class="divider">/</span></li>
    {% if instance.is_root and not instance.is_smart_folder %}{%else %}<li><a href="{% url 'admin:filer-directory_listing-root' %}" title="{% trans "Go back to root folder" %}">{% trans "root" %}</a><span class="divider">/</span></li>{% endif %}
    {% for ancestor_folder in instance.logical_path %}
    <li><a href="{{ ancestor_folder.get_admin_directory_listing_url_path }}" title="{% blocktrans with ancestor_folder.name as folder_name %}Go back to '{{ folder_name }}' folder{% endblocktrans %}">{% if ancestor_folder.label %}{{ ancestor_folder.label }}{% else %}{{ ancestor_folder.name }}{% endif %}</a><span class="divider">/</span></li>
    {% endfor %}
    {% if breadcrumbs_action %}
    <li><a href="{{ instance.get_admin_directory_listing_url_path }}" title="{% blocktrans with instance.name as folder_name %}Go back to '{{ folder_name }}' folder{% endblocktrans %}">{% if instance.label %}{{ instance.label }}{% else %}{{ instance.name }}{% endif %}</a><span class="divider">/</span></li>
    {{ breadcrumbs_action }}
    {% else %}
    {% if instance.label %}{{ instance.label }}{% else %}{{ instance.name }}{% endif %}
    {% endif %}
</ul>
